{% extends 'base.html' %}


{% block page-container %}
<div class="login-tab" >

  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist" id="logintab">
    <li role="presentation" class="active"><a href="#login" aria-controls="login" role="tab" data-toggle="tab">登录</a></li>
    <li role="presentation"><a href="#regist" aria-controls="regist" role="tab" data-toggle="tab">注册</a></li>

  </ul>

  <!-- Tab panes -->
  <div id="logintab-content" class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="login">
        {% if login_err %}
            <li><p style="color: red">{{ login_err }}</p></li>
        {% endif %}

        <form class="form-horizontal" name="frm-login" action="{% url 'login' %}" method="post">{% csrf_token %}
          <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">登录名</label>
            <div class="col-sm-10">
              <input name="username" class="form-control" id="login-user" placeholder="用户名">

            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
              <input name="password" type="password" class="form-control" id="login-password" placeholder="密码">
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <button type="submit" class="btn  btn-success center-block" onclick="return logincheck();">登录</button>
            </div>
          </div>
        </form>
    </div>
    <div role="tabpanel" class="tab-pane" id="regist">
        <form class="form-horizontal" name="frm-regist">{% csrf_token %}
          <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">登录名</label>
            <div class="col-sm-10">
              <input type="email" class="form-control" id="reg-user" placeholder="用户名">
            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" id="reg-password" placeholder="密码">
            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">确认密码</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" id="reg-confirm" placeholder="确认密码">
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <button type="submit" class="btn  btn-success center-block">注册</button>
            </div>
          </div>
        </form>
    </div>
  </div>

</div>



{% endblock %}

{% block self-js %}
<script type="text/javascript" src="/static/bootstrap/js/login.js"></script>
{% endblock %}